<template>
  <el-container class="bg-gray h-100 w-100">
    <el-header class="shadow-sm pt-4 d-flex justify-content-center bg-white" style="height: 80px;">
      <div class="w-100" style="line-heigth: 80px;">
        <el-button icon="el-icon-back" circle size="small" class="mr-3" @click="$router.go(-1)" v-show="$route.name !== 'province'"></el-button>
        <h5 class="d-inline">
          {{getTitle()}}
        </h5>
        <div class="float-right" v-show="$route.name === 'province'">
          <el-button type="primary" size="small" @click="$router.push({name: 'city'})" v-permission="[1]">地市三调办</el-button>
          <el-button type="primary" size="small" @click="$router.push({name: 'country'})" v-permission="[1, 3]">区县三调办</el-button>
        </div>
      </div>
    </el-header>
    <el-main class="p-0">
      <transition name="fade-transform" mode="out-in">
        <router-view />
      </transition>
    </el-main>
  </el-container>
</template>
<script>
export default {
  name: "thirdsurvey",
  title: "三调办",
  data() {
    return {};
  },
  methods: {
    getTitle () {
      if (this.$route.name === 'province') {
        if (this.$store.getters.userType === 1) {
          return '省级三调办'
        } else if (this.$store.getters.userType === 3) {
          return '市级三调办'
        } else if (this.$store.getters.userType === 4) {
          return '区县三调办'
        }
      } else {
        return this.$route.meta.title
      }
    }
  }
};
</script>
<style lang='scss'>
</style>